import { isNumPlus } from '@/utils/validate'

export const rulesCon = {
  engagement_code: [
    { required: true, message: '请输入项目编号', trigger: 'blur' }
  ],
  engagement_code_desc: [
    { required: true, message: '请输入项目说明', trigger: 'blur' }
  ],
  category: [
    { required: true, message: '请选择类别', trigger: 'change' }
  ],
  department_id: [
    { required: true, message: '请选择归属部门', trigger: 'change' }
  ],
  cc_rate: [
    { required: true, message: '请输入CCRatio', trigger: 'blur' },
    { validator: isNumPlus, trigger: 'blur' }
  ],
  oc_rate: [
    { required: true, message: '请输入OCRatio', trigger: 'blur' },
    { validator: isNumPlus, trigger: 'blur' }
  ],
  code_owner_id: [
    { required: true, message: '请选择项目负责人', trigger: 'change' }
  ],
  hr_id: [
    { required: true, message: '请选择HRBP', trigger: 'change' }
  ],
  team_leader_id: [
    { required: true, message: '请选择团队负责人', trigger: 'change' }
  ],
  finance_id: [
    { required: true, message: '请选择财务', trigger: 'change' }
  ]
}

export const rulesLev = {
  level_name: [
    { required: true, message: '请输入级别名称', trigger: 'blur' }
  ],
  cc_rate: [
    { required: true, message: '请输入CCRatio', trigger: 'blur' },
    { validator: isNumPlus, trigger: 'blur' }
  ],
  oc_rate: [
    { required: true, message: '请输入OCRatio', trigger: 'blur' },
    { validator: isNumPlus, trigger: 'blur' }
  ]
}

export const rulesRole = {
  name: [
    { required: true, message: '请输入角色名称', trigger: 'blur' }
  ]
}
